package com.example.stream;

import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 *
 */
public class TestCollect {

    String[] persons = new String[]{
            "政府办","区委办","政协","人大"
    };

    @Test
    public void testArray(){
        List<String> list = Arrays.stream(persons).collect(Collectors.toList());
        System.out.println("v1:"+list.size());
        List<String> list_v2 = list.stream().filter("政府办"::equals).collect(Collectors.toList());
        System.out.println("v2:"+list_v2.size());
    }
}
